Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: libbpf: fix USDT SIB argument handling causing unrecognized register error
version: 16
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=995900

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 2465bb8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=995900
version: 16

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 2660b9d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=995900
version: 16

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: d3abefe
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=995900
version: 16

…error

On x86-64, USDT arguments can be specified using Scale-Index-Base (SIB)
addressing, e.g. "1@-96(%rbp,%rax,8)". The current USDT implementation
in libbpf cannot parse this format, causing `bpf_program__attach_usdt()`
to fail with -ENOENT (unrecognized register).

This patch fixes this by implementing the necessary changes:
- add correct handling for SIB-addressed arguments in `bpf_usdt_arg`.
- add adaptive support to `__bpf_usdt_arg_type` and
  `__bpf_usdt_arg_spec` to represent SIB addressing parameters.

Signed-off-by: Jiawei Zhao <[email protected]>
…IB handling logic

When using GCC on x86-64 to compile an usdt prog with -O1 or higher
optimization, the compiler will generate SIB addressing mode for global
array, e.g. "1@-96(%rbp,%rax,8)".

In this patch:
- enrich subtest_basic_usdt test case to cover SIB addressing usdt argument spec
  handling logic

Signed-off-by: Jiawei Zhao <[email protected]>
@kernel-patches-daemon-bpf-rc kernel-patches-daemon-bpf-rc bot force-pushed the bpf-next_base branch 2 times, most recently from 721f1da to c2e9835 Compare August 28, 2025 00:18
@kernel-patches-daemon-bpf-rc
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=995900 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf-rc kernel-patches-daemon-bpf-rc bot deleted the series/995900=>bpf-next branch August 28, 2025 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants